home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Disc to the Future 2
/
Disc to the Future Part II Programmer's Reference (Wayzata Technology)(6013)(1992).bin
/
MAC
/
MPW_TOOL
/
TOOLS
/
TOOLS_WI
/
ICON_8
/
TESTS
/
WORDCNT.DAT
< prev
next >
Wrap
Text File
|
1990-03-02
|
511b
|
24 lines
#
# W O R D T A B U L A T I O N
#
# This main procedure processes standard input and writes the results
# with the words in a column 20 characters wide.
procedure main()
wordcount(20)
end
procedure wordcount(n)
local t, line, x, y
static letters
initial letters := &lcase ++ &ucase
t := table(,0)
every line := !&input do
scan line using
while tab(upto(letters)) do
t[tab(many(letters))] +:= 1
x := sort(t)
every y := !x do write(left(y[1],n),y[2])
end